<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>资料录入</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="/static/wx/lib/sui/sm.min.css">
    <link rel="stylesheet" href="/static/wx/lib/sui/sm-extend.min.css">
    <link rel="stylesheet" href="/static/wx/css/reset.css">
    <link rel="stylesheet" href="/static/wx/css/main.css">
    <link rel="stylesheet" href="/static/wx/css/public_main.css">

</head>

<body>
    <div class="page-group">
        <div class="page page-current" id="filerecord">

            <!-- 主内容 -->
            <div class="content bg-white">
                <div class="bs-box margin-t">
                    <div class="bs-box-content">
                        <div class="bs-box-inner">
                            <div class="bs-box-content-item width-link size-m">
                                <div>要求在</div>
                                <div>
                                    <input placeholder="请选择时间" id="should_at" value="{if isset($info.should_at)}{$info.should_at|substr=0,10}{/if}"/>
                                </div>
                                <div>处置完成</div>
                            </div>
                            <div class="bs-box-content-item">
                                <p class="size-m">物权单位</p>
                                <div>
                                    <input class="size-m" type="text" placeholder="请填写单位名称"  name="rem_company"  value="{if isset($info.rem_company)}{$info.rem_company}{/if}"/>
                                </div>
                            </div>
                            <div class="bs-box-content-item">
                                <p class="size-m">联系人</p>
                                <div>
                                    <input class="size-m" type="text" placeholder="请填写联系人名称" name="linkman" value="{if isset($info.linkman)}{$info.linkman}{/if}"/>
                                </div>
                            </div>
                            <div class="bs-box-content-item">
                                <p class="size-m">手机号</p>
                                <div>
                                    <input class="size-m" type="text" placeholder="请填写手机号"  name="connect_phone" value="{if isset($info.connect_phone)}{$info.connect_phone}{/if}"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <input type="hidden" value="{$policy_num}" name='policy_num'>
                <input type="hidden" value="{$p_id}" name='p_id'>
                <div class="btn-box">
                    <div class="my-btn" id="submit">
                        <span class="active">保存</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    </div>
    <script type='text/javascript' src='/static/wx/lib/sui/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/lib/sui/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='/static/wx/lib/sui/sm-extend.min.js' charset='utf-8'></script>
</body>
<script>
    $(function () {

        var n = $('.step-box').children().length;
        $('.step-item').css('width', document.body.clientWidth / n + 'px');

        var should_at = $("#should_at").val();
        $("#should_at").calendar({
            value: [should_at]
        });

        $(document).on('click', '#submit', function () {
            var poliecy = $("input[ name='policy_num']").val();
            var p_id = $("input[ name='p_id']").val();
            var should_at = $("#should_at").val()
            var rem_company = $("input[ name='rem_company']").val();
            var linkman = $("input[ name='linkman']").val();
            var connect_phone = $("input[ name='connect_phone']").val();
            $.ajax({
                type: 'POST',
                url: "{:url('Insurer/update')}",
                data: {
                    'policy_num': poliecy,
                    'should_at': should_at,
                    'rem_company': rem_company,
                    'linkman': linkman,
                    'connect_phone': connect_phone,
                },
                dataType: 'json',
                success: function (Json) {
                    if (Json.code == 200) {
                        $.alert('保存成功');
                        location.href="{:url('Insurer/insurerInfo')}?p_id="+p_id;
                    } else {
                        $.alert('保存失败');
                    }
                }
            });
        });

    });
</script>
</html>